﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace Forging2
{
    /// <summary>
    /// 对象前端关联
    /// </summary>
    public class Student : DependencyObject
    {
        public static readonly DependencyProperty NameProperty;
        public static readonly DependencyProperty AgeProperty;
        public static readonly DependencyProperty BirthdayProperty;
        public static readonly DependencyProperty CountryProperty;
        static Student()
        {
            NameProperty = DependencyProperty.Register("Name", typeof(string), typeof(Student), new PropertyMetadata("名称", OnValueChanged));
            AgeProperty = DependencyProperty.Register("Age", typeof(string), typeof(Student), new PropertyMetadata("年龄", OnValueChanged));
            BirthdayProperty = DependencyProperty.Register("Birthday", typeof(string), typeof(Student), new PropertyMetadata("生日", OnValueChanged));
            CountryProperty = DependencyProperty.Register("Country", typeof(string), typeof(Student), new PropertyMetadata("国家", OnValueChanged));
        }

        private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            //throw new NotImplementedException();
        }
        public string Name
        {
            get { return GetValue(NameProperty).ToString(); }
            set { SetValue(NameProperty, value); }
        }
        public string Age
        {
            get { return GetValue(AgeProperty).ToString(); }
            set { SetValue(AgeProperty, value); }
        }
        public string Birthday
        {
            get { return GetValue(BirthdayProperty).ToString(); }
            set { SetValue(BirthdayProperty, value); }
        }
        public string Country
        {
            get { return GetValue(CountryProperty).ToString(); }
            set { SetValue(CountryProperty, value); }
        }
    }
}
